
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="工号" prop="reportId">
        <el-input
          v-model="queryParams.reportId"
          placeholder="请输入登记人员工号"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专案名称" prop="projectName">
        <el-select v-model="queryParams.projectName" filterable allow-create placeholder="请选择或输入专案名称"
                   clearable :style="{width: '88%'}" class="spangutter">
          <el-option v-for="(item, index) in projectNameOptions" :key="index" :label="item.label"
                     :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="登记日期">
        <el-date-picker
          v-model="daterangeRegisterDate"
          size="small"
          style="width: 240px"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>


        <el-form-item label="状态" prop="matterStatus">
              <el-select v-model="queryParams.matterStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in dict.type.sys_completion_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
        </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">查询</el-button>
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="medium"
          @click="handleAdd"
          v-hasPermi="['info:information:add']"
        >提报事项
        </el-button>
        <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
      </el-form-item>
    </el-form>



      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>


    <el-table v-loading="loading" :data="securityAuditMatterList" @selection-change="handleSelectionChange">
      <el-table-column label="序号" align="center" prop="sId" sortable />
<!--      <el-table-column label="报告人ID" align="center" prop="reportId" />-->
      <el-table-column label="报告人" align="center" prop="reportName" />
      <el-table-column label="报告时间" align="center" prop="reportTime" width="120px" sortable >
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="事件分类" align="center" prop="eventClass" />
      <el-table-column label="专案名称" align="center" prop="projectName" />
      <el-table-column label="优先级别" align="center" prop="projectLevel" width="100px" sortable />
      <el-table-column label="专案位置" align="center" prop="projectLocation" />
      <el-table-column label="预计完成时间" align="center" prop="planCompletionTime" width="140px" sortable />
<!--      <el-table-column label="DRI人员ID" align="center" prop="driId" />-->
      <el-table-column label="DRI" align="center" prop="driName" />
<!--      <el-table-column label="指派给ID" align="center" prop="assignedId" />-->
      <el-table-column label="指派给" align="center" prop="assignedName" />
      <el-table-column label="职务" align="center" prop="duty" />
      <el-table-column label="问题描述" align="center" prop="describe" show-overflow-tooltip />
      <el-table-column label="完成时间" align="center" prop="completeTime" width="100px" sortable />
      <el-table-column label="完成说明" align="center" prop="completeDesc" show-overflow-tooltip />
      <el-table-column label="事项状态" align="center" prop="matterStatus" >
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_event_status" :value="scope.row.matterStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['mine:securityAuditMatter:edit']"
          >编辑</el-button>
<!--          <el-button-->
<!--            size="mini"-->
<!--            type="text"-->
<!--            icon="el-icon-delete"-->
<!--            @click="handleDelete(scope.row)"-->
<!--            v-hasPermi="['mine:securityAuditMatter:remove']"-->
<!--          >删除</el-button>-->
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改资安稽核事项对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
      <el-form ref="form" :disabled="editItem" :model="form" :rules="rules" label-width="110px">
        <el-row type="flex" justify="start" align="top">
          <el-col :span="12">
            <el-form-item label="事件分类" prop="eventClass">
              <!-- <el-input v-model="form.factoryName" placeholder="请输入厂区"  /> -->
              <el-select v-model="form.eventClass" filterable allow-create placeholder="请选择或输入事件"
                         clearable :style="{width: '88%'}" class="spangutter">
                <el-option v-for="(item, index) in eventClassOptions" :key="index" :label="item.label"
                           :value="item.value" :disabled="item.disabled"></el-option>
              </el-select>

            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="专案名称" prop="projectName">
              <!-- <el-input v-model="form.projectLevel" placeholder="请输入专案等级" /> -->
              <el-select v-model="form.projectName" filterable allow-create placeholder="请选择专案名称"
                         clearable :style="{width: '88%'}" class="spangutter">
                <el-option v-for="(item, index) in projectNameOptions" :key="index" :label="item.label"
                           :value="item.value" :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="12">
            <el-form-item label="优先级别" prop="projectLevel">
              <el-select  v-model="form.projectLevel" filterable allow-create placeholder="请选择优先级别"
                         clearable :style="{width: '88%'}" class="spangutter">
                <el-option v-for="(item, index) in projectLevelOptions" :key="index" :label="item.label"
                           :value="item.value" :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="专案位置" prop="projectLocation">
              <!-- <el-input v-model="form.floorNo" placeholder="请输入楼栋编号" /> -->
              <el-select v-model="form.projectLocation" filterable allow-create placeholder="请选择专案位置"
                         clearable :style="{width: '88%'}" class="spangutter">
                <el-option v-for="(item, index) in projectLocationOptions" :key="index" :label="item.label"
                           :value="item.value" :disabled="item.disabled"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex" justify="start" align="top">
          <el-col :span="12">
            <el-form-item label="DRI人员ID" prop="driId">
                  <el-select
                     v-model="form.driId"
                     :style="{width: '88%'}"
                      @change="drichange"
                      filterable
                      remote
                      reserve-keyword
                      placeholder="请输入或获取工号"
                      :remote-method="remoteMethodId"
                      :loading="loading">
                    <el-option
                      v-for="item in options4"
                      :key="item.empId"
                      :label="item.empId"
                      :value="item.empId">
                      <span style="float: left">{{item.empId}}</span>
                      <span style="float: right">{{item.empName}}</span>
                    </el-option>
                  </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="DRI联系人" prop="driName">
              <el-select
                     v-model="form.driName"
                     :style="{width: '88%'}"
                      @change="drinchange"
                      filterable
                      remote
                      reserve-keyword
                      placeholder="请输入或获取姓名"
                      :remote-method="remoteMethodName"
                      :loading="loading">
                    <el-option
                      v-for="item in options4"
                      :key="item.empId"
                      :label="item.empName"
                      :value="item.empName">
                      <span style="float: left">{{item.empId}}</span>
                      <span style="float: right">{{item.empName}}</span>
                    </el-option>
                  </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="12">
          <el-form-item label="指派给ID" prop="assignedId">
              <el-select
                     v-model="form.assignedId"
                     :style="{width: '88%'}"
                      @change="asgchange"
                      filterable
                      remote
                      reserve-keyword
                      placeholder="请输入或获取工号"
                      :remote-method="remoteMethodIds"
                      :loading="loading">
                    <el-option
                      v-for="item in options5"
                      :key="item.empId"
                      :label="item.empId"
                      :value="item.empId">
                      <span style="float: left">{{item.empId}}</span>
                      <span style="float: right">{{item.empName}}</span>
                    </el-option>
                  </el-select>
          </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指派给" prop="assignedName">
              <el-select
                     v-model="form.assignedName"
                     :style="{width: '88%'}"
                      @change="asnchange"
                      filterable
                      remote
                      reserve-keyword
                      placeholder="请输入或获取姓名"
                      :remote-method="remoteMethodNames"
                      :loading="loading">
                    <el-option
                      v-for="item in options5"
                      :key="item.empId"
                      :label="item.empName"
                      :value="item.empName">
                      <span style="float: left">{{item.empId}}</span>
                      <span style="float: right">{{item.empName}}</span>
                    </el-option>
                  </el-select>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="12">
            <el-form-item label="预计完成时间" prop="planCompletionTime">
              <!-- <el-input :style="{width: '88%'}" v-model="form.planCompletionTime" placeholder="请输入预计完成时间" class="spangutter" @input="searchFile()"
                        id="userIdInput"/> -->
               <el-date-picker
                v-model="form.planCompletionTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择日期"
                :style="{width: '88%'}">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="职务" prop="duty">
              <el-input :style="{width: '88%'}" v-model="form.duty" placeholder="自动获取职务" class="spangutter" readonly />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="23">
          <el-form-item label="问题描述" prop="describe">
            <el-input  :autosize="{ minRows: 3, maxRows: 8}" v-model="form.describe" type="textarea" placeholder="请输入问题描述"></el-input>
          </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex" justify="start" align="top">
          <el-col :span="23">
          <el-form-item label="完成说明" prop="completeDesc">
            <el-input  :autosize="{ minRows: 3, maxRows: 8}" v-model="form.completeDesc" type="textarea" placeholder="请输入完成说明"></el-input>
          </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary"  v-if="saveButton"     @click="submitForm">保 存</el-button>
        <el-button type="primary"  v-if="completeButton" @click="submitForm1">完 成</el-button>
        <el-button type="primary"  v-if="theCaseButton"  @click="submitForm2">结 案</el-button>
        <el-button type="primary"  v-if="submitButton"   @click="submitForm3">提 交</el-button>
        <el-button type="primary"  v-if="backButton"    @click="submitForm4">退 回</el-button>
        <el-button type="primary"  v-if="cancelButton"  @click="submitForm5">撤 回</el-button>
        <el-button @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<!-- 撤 回: admin 退 回:接收人-->
<script>
import { listSecurityAuditMatter,
          getSecurityAuditMatter,
          delSecurityAuditMatter,
          addSecurityAuditMatter,
          updateSecurityAuditMatter,
          exportSecurityAuditMatter,
          getInformationValue,
          listEmpByKey,
           getPowerId
           } from "@/api/mine/securityAuditMatter";

export default {
  name: "SecurityAuditMatter",
  dicts: ['sys_event_status'],
  data() {
    return {

      saveButton: true,

      completeButton: true,

      theCaseButton: true,

      submitButton: true,

      cancelButton: true,

      backButton: true,

      editItem: false,

      label: '',
      val: '',
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 资安稽核事项表格数据
      securityAuditMatterList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 事项状态 0:保存未提交 ,1:已提交, 2: 已完成 3:已结束时间范围
      daterangeReportTime: [],
      // 完成时间时间范围
      daterangeRegisterDate: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        registerDate: null,
        registerId: null,
        projectName: "",
        matterStatus: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        eventClass: [
          { required: true, message: "事件分类不能为空", trigger: "blur" }
        ],
        projectName: [
          { required: true, message: "专案名称不能为空", trigger: "blur" }
        ],
        projectLevel: [
          { required: true, message: "优先级别不能为空", trigger: "blur" }
        ],
        projectLocation: [
          { required: true, message: "专案位置不能为空", trigger: "blur" }
        ],
        planCompletionTime: [
          { required: true, message: "预计完成时间不能为空", trigger: "blur" }
        ],
        driId: [
          { required: true, message: "DRI人员ID不能为空", trigger: "blur" }
        ],
        driName: [
          { required: true, message: "DRI人员姓名不能为空", trigger: "blur" }
        ],
        assignedId: [
          { required: true, message: "指派给ID不能为空", trigger: "blur" }
        ],
        assignedName: [
          { required: true, message: "指派给姓名不能为空", trigger: "blur" }
        ]
      },
      eventClassOptions: [],
      projectNameOptions: [],
      projectLevelOptions: [],
      projectLocationOptions: [],
      driListoptions: [],
        options4: [],
        options5: [],
        value9: [],
        list: []


    };
  },
  created() {
    this.getList();
    console.log(this.securityAuditMatterList)
    this.getprojectNameList();
  },
  watch: {

  },

  methods: {
    /** 查询资安稽核事项列表 */
    getList() {
      this.loading = true;
      this.queryParams.params = {};
      if (null != this.daterangeReportTime && '' != this.daterangeReportTime) {
        this.queryParams.params["beginReportTime"] = this.daterangeReportTime[0];
        this.queryParams.params["endReportTime"] = this.daterangeReportTime[1];
      }
      listSecurityAuditMatter(this.queryParams).then(response => {
        // console.log("测试111",response);
        this.securityAuditMatterList = response.rows;
        console.log(response.rows)
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        sId: null,
        reportId: null,
        reportName: null,
        reportTime: null,
        eventClass: null,
        projectName: [],
        projectLevel: null,
        projectLocation: null,
        planCompletionTime: null,
        driId: null,
        driName: null,
        assignedId: null,
        assignedName: null,
        duty: null,
        describe: null,
        completeTime: null,
        completeDesc: null,
        matterStatus: null
      };
      this.resetForm("form");
    },
    //查询事件分类下拉框数据
    geteventClassList() {
      this.loading = true;
      let str = "eventClass"
      getInformationValue(str).then(response => {
        this.eventClassOptions = response.data;
        this.loading = false;
      });
    },
    //查询专案名称下拉框数据
    getprojectNameList() {
      this.loading = true;
      let str = "projectName"
      getInformationValue(str).then(response => {
        this.projectNameOptions = response.data;
        this.loading = false;
      });
    },
    //查询优先级别下拉框数据
    getprojectLevelList() {
      this.loading = true;
      let str = "projectLevel"
      getInformationValue(str).then(response => {
        this.projectLevelOptions = response.data;
        this.loading = false;
      });
    },
    //查询专案位置下拉框数据
    getprojectLocationList() {
      this.loading = true;
      let str = "projectLocation"
      getInformationValue(str).then(response => {
        this.projectLocationOptions = response.data;
        this.loading = false;
      });
    },
    drichange(val){
      for(var i = 0;i<this.options4.length;i++){
            if(this.options4[i].empId == val){
              this.form.driName = this.options4[i].empName;
            }
         }
    },
    drinchange(val){
      for(var i = 0;i<this.options4.length;i++){
            if(this.options4[i].empName == val){
              this.form.driId = this.options4[i].empId;
            }
         }
    },

    asgchange(val){
      for(var i = 0;i<this.options5.length;i++){
            if(this.options5[i].empId == val){
              this.form.duty = this.options5[i].title
              this.form.assignedName = this.options5[i].empName;
            }
         }
    },
    asnchange(val){
      for(var i = 0;i<this.options5.length;i++){
        if(this.options5[i].empName == val){
          this.form.duty = this.options5[i].title;
          this.form.assignedId = this.options5[i].empId
        }
      }
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.daterangeReportTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.sId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.options4 = []
      this.options5 = []
      this.title = "添加资安稽核事项";
      this.geteventClassList();
      this.getprojectNameList();
      this.getprojectLevelList();
      this.getprojectLocationList();

      this.saveButton = true;
      this.completeButton = false;
      this.theCaseButton = false;
      this.submitButton = true;
      this.cancelButton = false;
      this.backButton = false;
      this.editItem = false;          //整个详情页面中input中的的编辑和可编辑 disabled

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.geteventClassList();
      this.getprojectNameList();
      this.getprojectLevelList();
      this.getprojectLocationList();
      this.options4 = []
      this.options5 = []
      const sId = row.sId || this.ids
      getSecurityAuditMatter(sId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改资安稽核事项";

      });
      console.log("测试sid",sId)
      getPowerId(sId).then(response => {
        console.log("测试getpowerSID",response)
        // 如果(提交按钮)为0 就隐藏 反之就显示
        // 如果代码中编辑详情中的保存按钮为0  就保存按钮隐藏 反之就显示
        if(response.data.saveButton == 0) {
          this.saveButton = false
        }else if(response.data.saveButton == 1) {
          this.saveButton = true
        }
        // // 如果代码中返回的详情中的Table操作一列中的完成按钮为0 就完成按钮和包含那一列的完成按钮隐藏 反之就显示
        if(response.data.completeButton == 0) {
          this.completeButton = false
        } else if(response.data.completeButton == 1) {
          this.completeButton = true
        }

        // 如果代码中返回的结案按钮为0  就结案按钮隐藏 反之就显示
        if(response.data.theCaseButton == 0) {
          this.theCaseButton = false
        }else if(response.data.theCaseButton == 1) {
          this.theCaseButton = true
        }

        if (response.data.submitButton == 0) {
          this.submitButton = false
        }else if(response.data.submitButton == 1) {
          this.submitButton = true
        }

         // 如果代码中返回的撤回按钮为0 就撤回按钮隐藏 反之就显示

        if(response.data.cancelButton == 0) {
          this.cancelButton = false
        }else if(response.data.cancelButton == 1) {
          this.cancelButton = true
        }

        // // 如果代码中返回的退回按钮为0 就退回按钮隐藏 反之就显示
        if(response.data.backButton == 0) {
          this.backButton = false
        }else if(response.data.backButton == 1) {
          this.backButton = true
        }

        // 如果代码中详情中input中的编辑和可编辑可显示的话0  就为0  反之就隐藏
        if(response.data.editItem == 0) {
          this.editItem = true
        }else if(response.data.editItem == 1) {
          this.editItem = false
        }

      })

    },
    //DRI人员id获取姓名
     remoteMethodId(query) {
       console.log(query)
       if(query.length >= 7){
       listEmpByKey(query).then(response => {
         this.options4 = response.data;

         console.log(response.data)
       })
      }
    },
    remoteMethodName(query) {
       console.log(query)
       if(query.length >= 2&&query.length <= 4){
       listEmpByKey(query).then(response => {
         this.options4 = response.data;

         console.log(response.data)
       })
      }
    },
    remoteMethodIds(query) {
       console.log(query)
       if(query.length >= 7){
       listEmpByKey(query).then(response => {
         this.options5 = response.data;
         console.log(response.data)
       })
      }
    },
    remoteMethodNames(query) {
       console.log(query)
       if(query.length >= 2&&query.length <= 4){
       listEmpByKey(query).then(response => {
         this.options5 = response.data;
         console.log(response.data)
       })
      }
    },
    //指派给id获取信息

    /** 保存按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        console.log("测试",valid)
        if (valid) {
          this.form.matterStatus = "0";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    //完成按钮
    submitForm1() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.matterStatus = "4";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("完成成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("完成成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    //结案按钮
    submitForm2() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.matterStatus = "5";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("结案成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("结案成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    //提交按钮
    submitForm3() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.matterStatus = "1";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("提交成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("提交成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    //退回按钮
    submitForm4() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.matterStatus = "3";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("退回成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("退回成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    //撤回按钮
    submitForm5() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.matterStatus = "2";
          if (this.form.sId != null) {
            updateSecurityAuditMatter(this.form).then(response => {
              this.$modal.msgSuccess("撤回成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSecurityAuditMatter(this.form).then(response => {
              console.log(this.form)
              this.$modal.msgSuccess("撤回成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const sIds = row.sId || this.ids;
      this.$modal.confirm('是否确认删除资安稽核事项编号为"' + sIds + '"的数据项？').then(function() {
        return delSecurityAuditMatter(sIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$modal.confirm('是否确认导出所有资安稽核事项数据项？').then(() => {
        this.exportLoading = true;
        return exportSecurityAuditMatter(queryParams);
      }).then(response => {
        this.$download.name(response.msg);
        this.exportLoading = false;
      }).catch(() => {});
    }
  }
};
</script>
